package org.example.service;

import org.example.dao.UserDAO;
import org.example.dao.UserDAOImpl;
import org.example.model.User;

public class UserServiceImpl implements UserService {
    private UserDAO userDAO = new UserDAOImpl();
    
    @Override
    public boolean updateProfile(User user) {
        return userDAO.updateProfile(user);
    }
    
    @Override
    public User getUserById(Integer userId) {
        return userDAO.findById(userId);
    }
    
    @Override
    public User login(String username, String password) {
        return userDAO.findByUsernameAndPassword(username, password);
    }
    
    @Override
    public boolean register(User user) {
        return userDAO.save(user);
    }
} 